﻿/// <reference path="../../release/jsApp.js"/>

function Quirks() { }
//If the table has a border ff includes it in the width
Quirks.getTableWidth = function(tableIdSelector)
{
	var tableWidth = $(tableIdSelector).width();
	if (E.browser.chrome || E.browser.msie)
	{
		return tableWidth + 2;
	}
	return tableWidth;
};

Quirks.forceBlur = function()
{
	//when you select a different link chrome doesn't fire the blur event
	if (E.browser.webkit)
	{
		$("INPUT").blur();
	}
};

//WARNING: does not work in old versions of safari and chrome, but is a standard
Quirks.inputHasFocus = function()
{
	return document.activeElement && document.activeElement.tagName.toLowerCase() == "input";
};

Quirks.callLater = function(fn, delay)
{
	setTimeout(function()
	{
		fn();
	}, delay || 100);
};

Quirks.disableScrolling = function(e)
{
	if (E.browser.chrome)
	{
		e.stopPropagation();
		e.stopImmediatePropagation();
	}
}